<?php 
	require_once('Connections/con2.php');

	if( isset($_SESSION["autenticado"]) != true){
		header("Location: /sgs/?index.php&pg=login&res=erro");
	}
	
	mysql_select_db($database_con2, $con2);
	$query_rs_emp = "SELECT * FROM terceirizada";
	$rs_emp = mysql_query($query_rs_emp, $con2) or die(mysql_error());
	$row_rs_emp = mysql_fetch_assoc($rs_emp);
	$totalRows_rs_emp = mysql_num_rows($rs_emp);
?>

Empresas Terceirizadas Cadastradas

   <table width="984" border="0">
      <tr>
        <td>&nbsp;</td>
        <td width="170">&nbsp;</td>
      </tr>
      <tr>
        <td width="125"><div align="center"><strong>Registro</strong></div></td>
		<td><strong>Nome Fantasia</strong></td>     
        <td width="140"><strong>Razao Social</strong></td>   
        <td width="120"><strong>CNPJ</strong></td>
        <td width="170"><strong>Endereco</strong></td>                          
        <td width="140"><strong>Bairro</strong></td>
        <td width="89"><strong>CEP</strong></td>        
      </tr>
    </table>

<?php 
  //$total = 0; 
  
  do { ?>
  <div id="safe-result">    
   <table width="984" border="0">
      <tr>
        <td width="75"><?php echo $row_rs_emp['id']; ?></td>
		<td width="170"><?php echo $row_rs_emp['fantasia']; ?></td>
		<td width="140"><?php echo $row_rs_emp['razao']; ?></td>
		<td width="120"><?php echo $row_rs_emp['cnpj']; ?></td>
		<td width="170"><?php echo $row_rs_emp['endereco']; ?></td>
		<td width="140"><?php echo $row_rs_emp['bairro']; ?></td>        
		<td width="139"><?php echo $row_rs_emp['cep']; ?></td>    
      </tr>      
    </table>
  </div>
<?php //$total = $total +  $row_rs_emp['total'];
  } while ($row_rs_emp = mysql_fetch_assoc($rs_emp));
	
  //echo 'Total: ' . $total;
?>  

<?php
	mysql_free_result($rs_emp);
?>
